package com.springboot.cloud.demos.web.service;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.CouponForm;
import com.springboot.cloud.demos.entity.param.CouponQueryParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

@FeignClient(name = "ribbon-consumer", fallback = CouponServiceFallback.class)
public interface CouponService {

    @RequestMapping(value = "/conditions", method = RequestMethod.POST)
    Result conditions(CouponQueryParam params);

    @RequestMapping(value = "/coupon/{id}", method = RequestMethod.GET)
    Result coupon(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/coupon", method = RequestMethod.POST)
    Result add(@RequestBody CouponForm couponForm);

    @RequestMapping(value = "/coupon", method = RequestMethod.PUT)
    Result update(@RequestBody CouponForm couponForm);

    @RequestMapping(value = "/coupon/{id}", method = RequestMethod.DELETE)
    void delete(@PathVariable(value = "id") String id);
}
